<template>
  <deviceWorkindex :propFlowKey="propFlowKey"
                   :propBusType="constCommon.dictType.deviceBusTypeRepair"
                   propViewForm="device/device_repair/detail.vue"
                   propViewKey="device_work_repair"
                   :propFlowStatusIn="propFlowStatusIn"
                   :flowNodeListFilterFun="flowNodeListFilterFun"
                   :propInitData="{menuType: 'handle'}"
                   :flowButtonFilterFun="flowButtonFilterFun"
  />
</template>

<script>
import deviceWorkindex from '../device_work/device_work_index.vue'

export default {
  desc: '设备报修处理-列表',
  props: ['propFlowKey'],
  data() {
    return {
      propFlowStatusIn: [
        'dispatchend', //派单完成
        'repairing', //维修中
        'repairend', //维修完成
      ],

      // 需要显示的流程按钮
      flowButtonCodeList: ['toRepairing', 'toRepairend']
    }
  },
  computed: {
  },
  components: {
    deviceWorkindex
  },
  methods: {
    flowNodeListFilterFun(nodeList) {
      return nodeList.filter(item => this.propFlowStatusIn.includes(item.value))
    },
    flowButtonFilterFun(button, formData) {
      return this.flowButtonCodeList.includes(button.code)
    }
  }
}
</script>
